package com.cms.work.exception;

public class SystemException extends RuntimeException {

	private static final long serialVersionUID = 1L;
	
	private String msg;
	private ExceptionCodeEnum codeEnum;
	
	public SystemException(String msg) {
		super(msg);
		this.msg = msg;
	}
	
	public SystemException(ExceptionCodeEnum codeEnum) {
		super(codeEnum.getErrMsg());
		this.codeEnum = codeEnum;
		this.msg = codeEnum.getErrMsg();
	}

	public SystemException(String msg, Throwable throwable) {
		super(msg, throwable);
		this.msg = msg;
	}

	public SystemException(ExceptionCodeEnum codeEnum, Throwable throwable) {
		super(codeEnum.getErrMsg(), throwable);
		this.codeEnum = codeEnum;
		this.msg = codeEnum.getErrMsg();
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public ExceptionCodeEnum getCodeEnum() {
		return codeEnum;
	}

	public void setCodeEnum(ExceptionCodeEnum codeEnum) {
		this.codeEnum = codeEnum;
	}
	
}
